package com.joysuch.wwyt.workflow.entity;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.time.LocalDateTime;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * @Author ZhangDong
 * @Date 2020/11/4 15:52
 */
@Data
@Entity
@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Table(name = "WWYT_WORKFLOW_SCREEN_CONFIG")
@SQLDelete(sql = "update WWYT_WORKFLOW_SCREEN_CONFIG set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_WORKFLOW_SCREEN_CONFIG set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")
public class WorkFlowScreenConfig {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @ApiModelProperty("主键ID")
    private Long id;
    @ApiModelProperty("流程节点ID")
    private Long processId;
    @ApiModelProperty("专栏类型id")
    private Long typeId;
    @ApiModelProperty("显示顺序")
    private Integer showOrder;
    @ApiModelProperty("启用统计")
    private boolean openStatics;
    @ApiModelProperty("统计数据--预留功能字段")
    private String staticsData;
    @ApiModelProperty("列表字段")
    private String tableColumn;
    @ApiModelProperty("列表查询")
    private String tableQuery;
    @ApiModelProperty("列表分类")
    private String tableClassify;
    @ApiModelProperty("详情字段")
    private String detailColumn;
    @ApiModelProperty("地图小窗")
    private boolean mapWindow;
    @ApiModelProperty("小窗名称")
    private String windowName;
    @ApiModelProperty("小窗字段")
    private String windowColumn;
    @ApiModelProperty("显示/隐藏")
    @Column(name="`Show`")
    private Integer show;
    @ApiModelProperty("监测点实时数据显示/隐藏")
    private Integer valueShow;
    @ApiModelProperty("监测点实时数据按钮显示/隐藏")
    private Integer valueShowButton;
    @ApiModelProperty("业务流程名称 目前是写死的配置名称")
    private String bizTypeName;
    @ApiModelProperty("业务流程编码 目前是写死的配置编码")
    private String bizTypeCode;
    @ApiModelProperty("配置分类 0流程  1环境气体 2固定")
    private Integer environmentPointFlag;

    //通用字段
    @org.springframework.data.annotation.CreatedBy
    @ApiModelProperty("创建人")
    private Long createBy;
    @org.springframework.data.annotation.CreatedDate
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;
    @org.springframework.data.annotation.LastModifiedBy
    @ApiModelProperty("更新人")
    private Long updateBy;
    @org.springframework.data.annotation.LastModifiedDate
    @ApiModelProperty("更新时间")
    private LocalDateTime updateTime;
    @ApiModelProperty("租户")
    private Long tenentId;
    @ApiModelProperty("组织机构代码")
    private String orgCode;
    @ApiModelProperty("删除标记")
    private String deleteFlag;
}
